home *** CD-ROM | disk | FTP | other *** search
- Path: druid.borland.com!usenet
- From: pete@borland.com (Pete Becker)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP ! => Problem compiling STL classes in Visual C++ 4.1.
- Date: 10 Apr 1996 22:03:02 GMT
- Organization: Borland International
- Message-ID: <4khb6m$o5e@druid.borland.com>
- References: <4kh12t$rs0@newsbf02.news.aol.com>
- NNTP-Posting-Host: pbecker.borland.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=ISO-8859-1
- X-Newsreader: WinVN 0.99.5
-
- In article <4kh12t$rs0@newsbf02.news.aol.com>, haris1@aol.com says...
- >
- >I have problem compiling the following STL program
- >
- >namespace std
- >{
- >#include <Vector.h>
- >#include <Algo.h>
- >}
- >
- >
- >main ()
- >{
- > std::vector <int> v;
- >
- > v[0] = 1; v [1]=2; v[2]=3;
- >}
- >
- >I am getting an error.
- >"c:\msdev\stl\defalloc.h(124) : error C2660: 'new' :
- > function does not take 2 parameters"
- >
- >I am using Visual C++ 4.1 under Window NT. I would appreciate if
- >anybody could tell me how to resolve this problem. Apparently it looks
- >like there is no overloaded 'new' operator defined in this STL files.
-
- No, there isn't and there shouldn't be. Whoever advised you to add that
- namespace declaration around the #include directives gave you truly bad advice.
- You can't stick namespaces in from the outside. The headers must be written
- with namespaces in mind. Whoever it was, put them on your list of people to
- never ask for advice from. They don't know what they're talking about. Remove
- the namespace declaration and forget about putting the standard library into a
- namespace until it's supported natively.
-
-